<?php

use common\components\Upload;
use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\DdWxappSlideSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '首页幻灯片';
$this->params['breadcrumbs'][] = $this->title;
?>
<ul class="nav nav-tabs">
    <li>
        <?= Html::a('添加首页幻灯片', ['create'], ['class' => '']) ?>
    </li>
    <li  class="active">
        <?= Html::a('首页幻灯片管理', ['index'], ['class' => 'btn btn-primary']) ?>
    </li>
</ul>
<div class="firetech-main"  style="margin-top:20px;">

<div class="dd-wxapp-slide-index ">
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
    <div class="panel panel-default">
        <div class="box-body">
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
            'id',
            'images'=>[
                'attribute'=>'images',
                'format' => ['raw'],
                'value' => function($model){
                        $images = $model->images;
                        // return $ai_group_status;
                        return Html::img(Upload::tomdia($images),['width'=>100,'height'=>'auto']);
                    }
            ],
            'background'=>[
                'attribute'=>'background',
                'format' => ['raw'],
                'value' => function($model){
                        $background = $model->background;
                        // return $ai_group_status;
                        return Html::tag('span','颜色',['style'=>['background'=>$background]]);
                    }
            ],
            'url:url',
            'createtime',
            //'updatetime',
            ['class' => 'common\components\ActionColumn'],
        ],
    ]); ?>


</div>
    </div>
</div>
</div>